#!/usr/bin/env python3

import json, sys

with open(sys.argv[1]) as d, open(sys.argv[2]) as p:
  data = json.load(d)
  if not 'config' in data: data['config'] = {}
  if not 'preferences' in data['config']: data['config']['preferences'] = {}
  data['config']['preferences']['postscript'] = p.read()
with open(sys.argv[1], 'w') as d:
  json.dump(data, d, indent='  ')
